package com.yunche.yunchebusiness.mvp.model

import com.yunche.yunchebusiness.base.BaseResponse
import com.yunche.yunchebusiness.base.rx.SchedulerUtils
import com.yunche.yunchebusiness.entity.FinanceEntity
import com.yunche.yunchebusiness.entity.TenantBankList
import com.yunche.yunchebusiness.network.RetrofitManager
import io.reactivex.Observable
import okhttp3.RequestBody

/**
 * Create by Crcker on 2018/12/27 20:19
 * Email: Crcker@163.com
 */


class FinanceModel {

    fun getMoney(requestBody: RequestBody): Observable<BaseResponse<String>> {
        return RetrofitManager.service.saveFinance(requestBody).compose(SchedulerUtils.ioToMain())
    }

    fun getTotalPrice(): Observable<BaseResponse<FinanceEntity>> {
        return RetrofitManager.service.getTotalPrice().compose(SchedulerUtils.ioToMain())
    }

    fun getBankList(requestBody: RequestBody): Observable<BaseResponse<List<TenantBankList>>> {
        return RetrofitManager.service.getTenantBankList().compose(SchedulerUtils.ioToMain())
    }

}